﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DataAccess;
using System.Data;
namespace Business
{
    public class XuLyDangNhap
    {
        KhachHang khachHang = new KhachHang();

        public KhachHang khachhang
        {
            get { return khachHang; }
            set { khachHang = value; }
        }

        public int ThucThi()
        {
            TruyXuatDangNhapNguoiDung login = new TruyXuatDangNhapNguoiDung();
            DataTable dt = new DataTable();
            dt=login.LayDuLieu();
            foreach (DataRow dr in dt.Rows)
            {
                if (dr[0].ToString().CompareTo(khachhang.TenTaiKhoan) == 0 && dr[1].ToString().CompareTo(khachhang.MatKhau) == 0)
                {
                    return 1;
                }
                
            }
            return 0;
        }
    }
}
